package com.sanbi.erp.core.util;


import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 日期格式化工具类
 */
public class DateUtil {
    public static String getCurrentTimestamp(){
        return String.valueOf(Instant.now().toEpochMilli());
    }
    /**
     * @desc 判断是否为当前日期
     * @author wanggang
     * @time 2022/7/14 16:35
     */
    public static boolean isCurrentDate(LocalDateTime dateTime) {
        if (dateTime == null){
            return false;
        }
        return LocalDate.now().isEqual(dateTime.toLocalDate());
    }

    public static void main(String[] args) {
        LocalDateTime someDay=LocalDateTime.now().plusDays(-1);

        boolean isOk=isCurrentDate(someDay);
        System.out.println(getCurrentTimestamp());
    }

}
